<%@page import="com.entity.Task"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="top.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>编辑任务</title>
</head>
<body>
	
	<%
		Task task=(Task)session.getAttribute("task");
	 %>

	<div class="container well" style="width:800px">
		<h1>编辑任务</h1>
		
		<div>
			<form id="form" action="updatetask.jspx" method="post" class="form-horizontal well">
						
						<div class="form-inline">
							<label>任务名称</label><br>
							<input style="height:30px" type="text" class="input-xlarge disabled" disabled="" value="<%=task.getName() %>" name = "taskName">
						</div>
						
						<br /><br />
						<label>任务描述</label>
						<textarea rows="3" id="textarea" class="span7 disabled" disabled="" name = "taskDesc"><%=task.getDesc() %></textarea>
						<br /><br />
						<label>负责人</label>
						<select id="select01" name="taskAdmin" class="disabled" disabled="">
							<option value="<%=employee.getId()%>"><%=employee.getUsername() %></option>
						</select>
						<br /><br />
						<label>任务状态</label>
						<select id="select02" name="taskState">
							<%
								if("新任务".equals(task.getState())){
							 %>
							<option value="n" selected="selected">新任务</option>
							<option value="g">进行中</option>
							<option value="c">已完成</option>
							<%
								}
							 %>
							 
							 <%
								if("进行中".equals(task.getState())){
							 %>
							<option value="n" >新任务</option>
							<option value="g" selected="selected">进行中</option>
							<option value="c">已完成</option>
							<%
								}
							 %>
							 
							 <%
								if("已完成".equals(task.getState())){
							 %>
							<option value="n" >新任务</option>
							<option value="g">进行中</option>
							<option value="c" selected="selected">已完成</option>
							<%
								}
							 %>
						</select>
						<br /><br />
						<label>任务级别</label>
						<select id="select03" name="taskLevel" class="disabled" disabled="">
							<option value=""><%=task.getLevel() %></option>
							
						</select>
						<br /><br />
						<label>任务开始时间</label>
						<div class="form-inline" >
							<input type="text" class="disabled" disabled="" style="height:30px" name="starttime" value="<%=task.getBegintime()%>">
						</div>
						
						<label>任务结束时间</label>
						<div class="form-inline" >
							<input type="text" class="disabled" disabled="" style="height:30px" name="endtime" value="<%=task.getEndtime()%>">
						</div>
						
						<label>当前进度</label>
						<div class="form-inline" >
							<input id="input01" type="text" style="height:30px" name="progress" value="<%=task.getRate()%>">
						</div>
						
						<div class="form-actions">
							<button class="btn btn-primary" type="submit">保存任务</button>
							<a class="btn" href="task.jspx">取消</a>
						</div>
						
			</form>
		</div>
	</div>
	<script type="text/javascript">
		document.getElementById("form").onsubmit=function(){
			
			var input01 = document.getElementById("input01").value;
			
			if(input01.trim() == "") {
				
				document.getElementById("input01_msg").innerHTML = "请输入任务进度";
				document.getElementById("input01").focus();
				return false;
			}
			
		};
		
		document.getElementById("input01").onkeydown = function(){
			
			document.getElementById("input01_msg").innerHTML = "";
		};
		
	</script>
</body>
</html>
